@import (reference) '../../base.less';

@gap: 8px;

.@{prefix-cls}-drawing-bar {
  width: @drawing-bar-width;
  height: 100%;
  box-sizing: border-box;
  border-right: solid 1px var(--klinecharts-pro-border-color);
  .item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    margin-top: @gap;
    cursor: pointer;
    color: var(--klinecharts-pro-text-second-color);
    fill: var(--klinecharts-pro-text-second-color);
    stroke: var(--klinecharts-pro-text-second-color);
    .icon-overlay {
      width: 32px;
      height: 32px;
      border-radius: 2px;
      transition: all 0.2s;
      &:hover {
        background-color: var(--klinecharts-pro-hover-background-color);
      }
      &.selected {
        background-color: var(--klinecharts-pro-selected-color)!important;
        fill: var(--klinecharts-pro-primary-color);
        stroke: var(--klinecharts-pro-primary-color);
      }
    }
    .icon-arrow {
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: center;
      position: absolute;
      top: 0;
      right: 0;
      height: 32px;
      width: 10px;
      opacity: 0;
      transition: all .2s;
      border-top-left-radius: 2px;
      border-bottom-left-radius: 2px;
      z-index: 10;
      svg {
        width: 4px;
        height: 6px;
        transition: all .2s;
        &.rotate {
          transform: rotate(180deg);
        }
      }
      &:hover {
        background-color: var(--klinecharts-pro-hover-background-color);
      }
    }

    .list {
      position: absolute;
      top: 0;
      white-space: nowrap;
      left: calc(100% + 1px);
      background-color: var(--klinecharts-pro-popover-background-color);
      z-index: 99;
      box-shadow: 0 6px 12px 0 rgba(0, 0, 0, .3);
      min-height: auto;
      max-height: 320px;
      li {
        padding-left: 16px;
        .icon-overlay {
          &:hover {
            background-color: transparent;
          }
        }
      }
    }
    
    &:hover {
      .icon-arrow {
        opacity: 1;
      }
    }
  }

  .split-line {
    display: block;
    width: 100%;
    height: 1px;
    background-color: var(--klinecharts-pro-border-color);
    margin-top: @gap;
  }
}